#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int n;
char f(int x)
{
	if (x % n < 10)
		return x % n + '0';
	else
		return x % n + 'A' - 10;
}
string fx(int x)
{
	string a;
	for (int i = 0;x > 0;i++) a += f(x), x /= n;
	reverse(a.begin(), a.end());
	return a;
}

int main()
{
	
	cin >> n;
	for (int i = 1;i < n;i++)
	{
		for (int j = 1;j <= i;j++)
		{
			cout << fx(i) << '*' << fx(j) << '=' << fx(i * j)<<' ';
		}
		printf("\n");
	}
	return 0;
}
